<?php
class create_table extends db
{
    public function index()
    {
    if(!empty($_REQUEST['main_left_sub']))
        {
            echo <<<ETO
            <style>
             *
             {
                 text-align:center;
             }
                table
             {
                 width:40%;
                 float:left;
                 margin:0 0 20px 20px;
                 font-size:15px;
             }
    </style>
ETO;
            if(!empty($_REQUEST['main_left_title']))
            {
                echo "<h2>";
                echo $_REQUEST['main_left_title'];
                echo "</h2>";
            }
            foreach ($_REQUEST['group'] as $team_id => $team_member) 
            {  
                echo <<<ETO
                <table border=1>
                <tr>
                <td colspan="4">
ETO;
                echo '第'.$team_id.'组';
                echo <<<ETO
                </td>
                </tr>
                <tr>
                <td>姓名</td>
                <td>电话</td>
                <td>身份证号</td>
                <td>备注</td>
                </tr>
ETO;
                $data = $this->get_member_by_id($team_member);
                foreach ($data as $value) 
                {
                    echo <<<ETO
                    <tr>
                    <td>$value[2]</td>
                    <td>$value[6]</td>
                    <td>$value[7]</td>
                    <td></td>
                    </tr>
ETO;
                }
                echo "</table>";
            }
        }
    }
}
?>
